package com.sunagy.demand.backend.controller;

import com.sunagy.demand.backend.VO.ResultVO;
import com.sunagy.demand.backend.VO.request.CustomerUserInfoDto;
import com.sunagy.demand.backend.service.CustomerUserInfoService;
import com.sunagy.demand.backend.utils.ResultVOUtil;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Slf4j
@RestController
@RequestMapping("/customerUser")
@Api(value = "用户端帐号模块", description = "用户端帐号模块")
public class CustomerUserController {

    @Autowired
    private CustomerUserInfoService customerUserInfoService;


    @ApiOperation(value = "查询用户", notes = "查询所有用户")
    @ApiResponses({
            @ApiResponse(code = 500, message = "接口异常")
    })
    @RequestMapping(value = "", method = RequestMethod.GET)
    public ResultVO<List<CustomerUserInfoDto>> getAll() {
        List<CustomerUserInfoDto> customerUserInfoDtoList = customerUserInfoService.getAll();
        return ResultVOUtil.success(customerUserInfoDtoList);
    }

}
